﻿/*
* Copyright (C) 2020 ~ 2024 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#ifndef MK_MD5_ENCODE_H
#define MK_MD5_ENCODE_H
#include "MkUtil/MkTypes.h"

class MkApi CMkMd5Encode
{
public:
    CMkMd5Encode();
    ~CMkMd5Encode();
    static MkString Encode(const MkString& Src, BOOL bLowLetters = TRUE);

private:
    void AddData(const Uint8* InputData, Uint32 DataSize);
    void Finalize(Uint8* OutputBytes);
    void Zeroize();
    void Transform64Bytes(const Uint8 Block[64]);

private:
    Uint32 m_State[4];
    Uint64 m_BitCount;
    Uint8 m_WorkingBuffer[64];
};
#endif
